﻿<%@ Page Title="" Language="C#" MasterPageFile="~/App_SiteMasterPage/Site.Master"
    AutoEventWireup="true" CodeBehind="ChangePass.aspx.cs" Inherits="eProject.Web.UI.ChangePassPage" %>

<%@ Register Src="~/Controls/MemberMenu.ascx" TagName="MemberMenu" TagPrefix="uc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="script" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="LeftContent" runat="server">
    <uc:MemberMenu ID="MemberMenu" runat="server" />
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="RightContent" runat="server">
    <div class="widget">
        <div class="widget-inner">
            <div class="widget-title">
                <h5>
                    <asp:Literal ID="ltHeader" runat="server" /></h5>
            </div>
            <div class="widget-content">
                <!--[if lt IE 9]><div class="ie"><![endif]-->
                <div id="Result" visible="false" class="txtError" runat="Server" align="center">
                    <asp:Literal ID="ResultError" runat="server" />
                </div>
                <asp:ValidationSummary ID="sumRegister" runat="server" ValidationGroup="ChangePass"
                    CssClass="frmValidation" />
                <div class="frm">
                    <fieldset>
                        <dl>
                            <dt>
                                <asp:Label ID="lblOldPass" runat="server" AssociatedControlID="txtOldPass" />
                            </dt>
                            <dd>
                                <asp:TextBox ID="txtOldPass" ValidationGroup="ChangePass" TextMode="Password" runat="server" />
                                <asp:CustomValidator ID="cusOldPass" runat="server" ValidationGroup="ChangePass" Display="Dynamic"
                                    CssClass="txtError" ClientValidationFunction="cusOldPass_ClientValidate" Text="*" />
                            </dd>
                        </dl>
                        <dl>
                            <dt>
                                <asp:Label ID="lblNewPass" runat="server" AssociatedControlID="txtNewPass" />
                            </dt>
                            <dd>
                                <asp:TextBox ID="txtNewPass" ValidationGroup="ChangePass" TextMode="Password" runat="server" />
                                <asp:CustomValidator ID="cusNewPass" runat="server" ValidationGroup="ChangePass" Display="Dynamic"
                                    CssClass="txtError" ClientValidationFunction="cusNewPass_ClientValidate" Text="*" />
                            </dd>
                        </dl>
                        <dl>
                            <dt>
                                <asp:Label ID="lblConfirm" runat="server" AssociatedControlID="txtConfirm" />
                            </dt>
                            <dd>
                                <asp:TextBox ID="txtConfirm" ValidationGroup="ChangePass" TextMode="Password" runat="server" />
                                <asp:CompareValidator ID="cpConfirm" runat="server" ControlToValidate="txtConfirm"
                                    ControlToCompare="txtNewPass" ValidationGroup="ChangePass" Display="Dynamic" CssClass="txtError"
                                    Text="*" ErrorMessage="Comfirm password not match." />
                            </dd>
                        </dl>
                    </fieldset>
                    <fieldset class="div-button">
                        <div>
                            <asp:Button ID="btnSave" runat="server" CssClass="btn button1" ValidationGroup="ChangePass"
                                Text="Save" />
                            <input class="btn button2" name="btn_cancel" value="Reset" type="reset" />
                        </div>
                    </fieldset>
                </div>
                <!--[if lt IE 9]></div><![endif]-->
            </div>
        </div>
    </div>
    <script type="text/javascript">

        function cusOldPass_ClientValidate(sender, args) {
            var password = $('#<%=txtOldPass.ClientID%>');
            if (password.val().length == 0) {
                sender.errormessage = "Enter current password.";
                args.IsValid = false;
            }
            else if (password.val().length < 4 || password.val().length > 15) {
                sender.errormessage = "Password 4-15 character.";
                args.IsValid = false;
            }
        }

        function cusNewPass_ClientValidate(sender, args) {
            var password = $('#<%=txtNewPass.ClientID%>');
            if (password.val().length == 0) {
                sender.errormessage = "Enter new password.";
                args.IsValid = false;
            }
            else if (password.val().length < 4 || password.val().length > 15) {
                sender.errormessage = "New password 4-15 character.";
                args.IsValid = false;
            }
        }

    </script>
</asp:Content>
